package org.naxx.security.datatype;

public final class DataType {

	private Integer id;
	private String uri;
	private String name;
	private boolean isGeneric;
	private boolean isFunction;
	private boolean isExtension;
	private String javaTypeName;
	
	public DataType() {
	}

	public DataType(Integer id, String uri, String name,
			boolean isFunction, boolean isGeneric, boolean isExtension, String javaTypeName) {
		this.id = id;
		this.isFunction = isFunction;
		this.isGeneric = isGeneric;
		this.name = name;
		this.uri = uri;
		this.isExtension = isExtension;
		this.javaTypeName = javaTypeName;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUri() {
		return this.uri;
	}
	public void setUri(String uri) {
		this.uri = uri;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isGeneric() {
		return this.isGeneric;
	}
	public void setIsGeneric(boolean isGeneric) {
		this.isGeneric = isGeneric;
	}
	public boolean isFunction() {
		return this.isFunction;
	}
	public void setIsFunction(boolean isFunction) {
		this.isFunction = isFunction;
	}
	public boolean isExtension() {
		return isExtension;
	}
	public void setIsExtension(boolean isExtension) {
		this.isExtension = isExtension;
	}
	public void setGeneric(boolean isGeneric) {
		this.isGeneric = isGeneric;
	}
	public void setFunction(boolean isFunction) {
		this.isFunction = isFunction;
	}
	public String getJavaTypeName() {
		return this.javaTypeName;
	}
	public void setJavaTypeName(String javaTypeName) {
		this.javaTypeName = javaTypeName;
	}

	public int hashCode() {
		return this.id.hashCode() + this.uri.hashCode();
	}
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj instanceof DataType) {
			DataType rhs = (DataType) obj;
			return this.id.equals(rhs.getId()) && this.uri.equals(rhs.getUri());
		}
		return false;
	}

	public String toString() {
		return "[DataType:(uri=" + this.uri + ")(id=" + this.id + ")" +
				"(name=" + this.name + ")(isGeneric=" + this.isGeneric + ")(isFunction=" 
					+ this.isFunction + ")(isExtension=" + this.isExtension + ")" +
							"(javaTypeName=" + this.javaTypeName + ")]";
	}	
}
